3.2.23 \(\int x^m \cos ^4(a+b \log (c x^n)) \, dx\) [123]

3.2.23.1 Optimal result
3.2.23.2 Mathematica [A] (verified)
3.2.23.3 Rubi [A] (verified)
3.2.23.4 Maple [A] (verified)
3.2.23.5 Fricas [A] (verification not implemented)
3.2.23.6 Sympy [F(-1)]
3.2.23.7 Maxima [B] (verification not implemented)
3.2.23.8 Giac [B] (verification not implemented)
3.2.23.9 Mupad [B] (verification not implemented)

3.2.23.1 Optimal result

Integrand size = 17, antiderivative size = 266 \[ \int x^m \cos ^4\left (a+b \log \left (c x^n\right )\right ) \, dx=\frac {24 b^4 n^4 x^{1+m}}{(1+m) \left ((1+m)^2+4 b^2 n^2\right ) \left ((1+m)^2+16 b^2 n^2\right )}+\frac {12 b^2 (1+m) n^2 x^{1+m} \cos ^2\left (a+b \log \left (c x^n\right )\right )}{\left ((1+m)^2+4 b^2 n^2\right ) \left ((1+m)^2+16 b^2 n^2\right )}+\frac {(1+m) x^{1+m} \cos ^4\left (a+b \log \left (c x^n\right )\right )}{(1+m)^2+16 b^2 n^2}+\frac {24 b^3 n^3 x^{1+m} \cos \left (a+b \log \left (c x^n\right )\right ) \sin \left (a+b \log \left (c x^n\right )\right )}{\left ((1+m)^2+4 b^2 n^2\right ) \left ((1+m)^2+16 b^2 n^2\right )}+\frac {4 b n x^{1+m} \cos ^3\left (a+b \log \left (c x^n\right )\right ) \sin \left (a+b \log \left (c x^n\right )\right )}{(1+m)^2+16 b^2 n^2} \]

output
24*b^4*n^4*x^(1+m)/(1+m)/((1+m)^2+4*b^2*n^2)/((1+m)^2+16*b^2*n^2)+12*b^2*( 
1+m)*n^2*x^(1+m)*cos(a+b*ln(c*x^n))^2/((1+m)^2+4*b^2*n^2)/((1+m)^2+16*b^2* 
n^2)+(1+m)*x^(1+m)*cos(a+b*ln(c*x^n))^4/((1+m)^2+16*b^2*n^2)+24*b^3*n^3*x^ 
(1+m)*cos(a+b*ln(c*x^n))*sin(a+b*ln(c*x^n))/((1+m)^2+4*b^2*n^2)/((1+m)^2+1 
6*b^2*n^2)+4*b*n*x^(1+m)*cos(a+b*ln(c*x^n))^3*sin(a+b*ln(c*x^n))/((1+m)^2+ 
16*b^2*n^2)
 
3.2.23.2 Mathematica [A] (verified)

Time = 3.06 (sec) , antiderivative size = 312, normalized size of antiderivative = 1.17 \[ \int x^m \cos ^4\left (a+b \log \left (c x^n\right )\right ) \, dx=\frac {1}{8} x^{1+m} \left (\frac {3}{1+m}-\frac {4 \sin (2 b n \log (x)) \left (-2 b n \cos \left (2 \left (a-b n \log (x)+b \log \left (c x^n\right )\right )\right )+(1+m) \sin \left (2 \left (a-b n \log (x)+b \log \left (c x^n\right )\right )\right )\right )}{1+2 m+m^2+4 b^2 n^2}+\frac {4 \cos (2 b n \log (x)) \left ((1+m) \cos \left (2 \left (a-b n \log (x)+b \log \left (c x^n\right )\right )\right )+2 b n \sin \left (2 \left (a-b n \log (x)+b \log \left (c x^n\right )\right )\right )\right )}{1+2 m+m^2+4 b^2 n^2}-\frac {\sin (4 b n \log (x)) \left (-4 b n \cos \left (4 \left (a-b n \log (x)+b \log \left (c x^n\right )\right )\right )+(1+m) \sin \left (4 \left (a-b n \log (x)+b \log \left (c x^n\right )\right )\right )\right )}{1+2 m+m^2+16 b^2 n^2}+\frac {\cos (4 b n \log (x)) \left ((1+m) \cos \left (4 \left (a-b n \log (x)+b \log \left (c x^n\right )\right )\right )+4 b n \sin \left (4 \left (a-b n \log (x)+b \log \left (c x^n\right )\right )\right )\right )}{1+2 m+m^2+16 b^2 n^2}\right ) \]

input
Integrate[x^m*Cos[a + b*Log[c*x^n]]^4,x]
 
output
(x^(1 + m)*(3/(1 + m) - (4*Sin[2*b*n*Log[x]]*(-2*b*n*Cos[2*(a - b*n*Log[x] 
 + b*Log[c*x^n])] + (1 + m)*Sin[2*(a - b*n*Log[x] + b*Log[c*x^n])]))/(1 + 
2*m + m^2 + 4*b^2*n^2) + (4*Cos[2*b*n*Log[x]]*((1 + m)*Cos[2*(a - b*n*Log[ 
x] + b*Log[c*x^n])] + 2*b*n*Sin[2*(a - b*n*Log[x] + b*Log[c*x^n])]))/(1 + 
2*m + m^2 + 4*b^2*n^2) - (Sin[4*b*n*Log[x]]*(-4*b*n*Cos[4*(a - b*n*Log[x] 
+ b*Log[c*x^n])] + (1 + m)*Sin[4*(a - b*n*Log[x] + b*Log[c*x^n])]))/(1 + 2 
*m + m^2 + 16*b^2*n^2) + (Cos[4*b*n*Log[x]]*((1 + m)*Cos[4*(a - b*n*Log[x] 
 + b*Log[c*x^n])] + 4*b*n*Sin[4*(a - b*n*Log[x] + b*Log[c*x^n])]))/(1 + 2* 
m + m^2 + 16*b^2*n^2)))/8
 
3.2.23.3 Rubi [A] (verified)

Time = 0.41 (sec) , antiderivative size = 232, normalized size of antiderivative = 0.87, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.176, Rules used = {4991, 4991, 15}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int x^m \cos ^4\left (a+b \log \left (c x^n\right )\right ) \, dx\)

\(\Big \downarrow \) 4991

\(\displaystyle \frac {12 b^2 n^2 \int x^m \cos ^2\left (a+b \log \left (c x^n\right )\right )dx}{16 b^2 n^2+(m+1)^2}+\frac {(m+1) x^{m+1} \cos ^4\left (a+b \log \left (c x^n\right )\right )}{16 b^2 n^2+(m+1)^2}+\frac {4 b n x^{m+1} \sin \left (a+b \log \left (c x^n\right )\right ) \cos ^3\left (a+b \log \left (c x^n\right )\right )}{16 b^2 n^2+(m+1)^2}\)

\(\Big \downarrow \) 4991

\(\displaystyle \frac {12 b^2 n^2 \left (\frac {2 b^2 n^2 \int x^mdx}{4 b^2 n^2+(m+1)^2}+\frac {(m+1) x^{m+1} \cos ^2\left (a+b \log \left (c x^n\right )\right )}{4 b^2 n^2+(m+1)^2}+\frac {2 b n x^{m+1} \sin \left (a+b \log \left (c x^n\right )\right ) \cos \left (a+b \log \left (c x^n\right )\right )}{4 b^2 n^2+(m+1)^2}\right )}{16 b^2 n^2+(m+1)^2}+\frac {(m+1) x^{m+1} \cos ^4\left (a+b \log \left (c x^n\right )\right )}{16 b^2 n^2+(m+1)^2}+\frac {4 b n x^{m+1} \sin \left (a+b \log \left (c x^n\right )\right ) \cos ^3\left (a+b \log \left (c x^n\right )\right )}{16 b^2 n^2+(m+1)^2}\)

\(\Big \downarrow \) 15

\(\displaystyle \frac {(m+1) x^{m+1} \cos ^4\left (a+b \log \left (c x^n\right )\right )}{16 b^2 n^2+(m+1)^2}+\frac {4 b n x^{m+1} \sin \left (a+b \log \left (c x^n\right )\right ) \cos ^3\left (a+b \log \left (c x^n\right )\right )}{16 b^2 n^2+(m+1)^2}+\frac {12 b^2 n^2 \left (\frac {(m+1) x^{m+1} \cos ^2\left (a+b \log \left (c x^n\right )\right )}{4 b^2 n^2+(m+1)^2}+\frac {2 b n x^{m+1} \sin \left (a+b \log \left (c x^n\right )\right ) \cos \left (a+b \log \left (c x^n\right )\right )}{4 b^2 n^2+(m+1)^2}+\frac {2 b^2 n^2 x^{m+1}}{(m+1) \left (4 b^2 n^2+(m+1)^2\right )}\right )}{16 b^2 n^2+(m+1)^2}\)

input
Int[x^m*Cos[a + b*Log[c*x^n]]^4,x]
 
output
((1 + m)*x^(1 + m)*Cos[a + b*Log[c*x^n]]^4)/((1 + m)^2 + 16*b^2*n^2) + (4* 
b*n*x^(1 + m)*Cos[a + b*Log[c*x^n]]^3*Sin[a + b*Log[c*x^n]])/((1 + m)^2 + 
16*b^2*n^2) + (12*b^2*n^2*((2*b^2*n^2*x^(1 + m))/((1 + m)*((1 + m)^2 + 4*b 
^2*n^2)) + ((1 + m)*x^(1 + m)*Cos[a + b*Log[c*x^n]]^2)/((1 + m)^2 + 4*b^2* 
n^2) + (2*b*n*x^(1 + m)*Cos[a + b*Log[c*x^n]]*Sin[a + b*Log[c*x^n]])/((1 + 
 m)^2 + 4*b^2*n^2)))/((1 + m)^2 + 16*b^2*n^2)
 

3.2.23.3.1 Defintions of rubi rules used

rule 15
Int[(a_.)*(x_)^(m_.), x_Symbol] :> Simp[a*(x^(m + 1)/(m + 1)), x] /; FreeQ[ 
{a, m}, x] && NeQ[m, -1]
 

rule 4991
Int[Cos[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))*(d_.)]^(p_)*((e_.)*(x_))^(m_. 
), x_Symbol] :> Simp[(m + 1)*(e*x)^(m + 1)*(Cos[d*(a + b*Log[c*x^n])]^p/(b^ 
2*d^2*e*n^2*p^2 + e*(m + 1)^2)), x] + (Simp[b*d*n*p*(e*x)^(m + 1)*Sin[d*(a 
+ b*Log[c*x^n])]*(Cos[d*(a + b*Log[c*x^n])]^(p - 1)/(b^2*d^2*e*n^2*p^2 + e* 
(m + 1)^2)), x] + Simp[b^2*d^2*n^2*p*((p - 1)/(b^2*d^2*n^2*p^2 + (m + 1)^2) 
)   Int[(e*x)^m*Cos[d*(a + b*Log[c*x^n])]^(p - 2), x], x]) /; FreeQ[{a, b, 
c, d, e, m, n}, x] && IGtQ[p, 1] && NeQ[b^2*d^2*n^2*p^2 + (m + 1)^2, 0]
 
3.2.23.4 Maple [A] (verified)

Time = 127.38 (sec) , antiderivative size = 222, normalized size of antiderivative = 0.83

method result size
parallelrisch \(\frac {\left (\left (1+m \right )^{2} \left (b^{2} n^{2}+\frac {1}{16} m^{2}+\frac {1}{8} m +\frac {1}{16}\right ) \cos \left (2 b \ln \left (c \,x^{n}\right )+2 a \right )+\frac {\left (1+m \right )^{2} \left (b^{2} n^{2}+\frac {1}{4} m^{2}+\frac {1}{2} m +\frac {1}{4}\right ) \cos \left (4 b \ln \left (c \,x^{n}\right )+4 a \right )}{16}+2 \left (1+m \right ) b n \left (b^{2} n^{2}+\frac {1}{16} m^{2}+\frac {1}{8} m +\frac {1}{16}\right ) \sin \left (2 b \ln \left (c \,x^{n}\right )+2 a \right )+\frac {\left (\left (1+m \right ) b n \sin \left (4 b \ln \left (c \,x^{n}\right )+4 a \right )+12 b^{2} n^{2}+\frac {3 m^{2}}{4}+\frac {3 m}{2}+\frac {3}{4}\right ) \left (b^{2} n^{2}+\frac {1}{4} m^{2}+\frac {1}{2} m +\frac {1}{4}\right )}{4}\right ) x^{1+m}}{8 \left (1+m \right ) \left (b^{2} n^{2}+\frac {1}{16} m^{2}+\frac {1}{8} m +\frac {1}{16}\right ) \left (b^{2} n^{2}+\frac {1}{4} m^{2}+\frac {1}{2} m +\frac {1}{4}\right )}\) \(222\)

input
int(x^m*cos(a+b*ln(c*x^n))^4,x,method=_RETURNVERBOSE)
 
output
1/8*((1+m)^2*(b^2*n^2+1/16*m^2+1/8*m+1/16)*cos(2*b*ln(c*x^n)+2*a)+1/16*(1+ 
m)^2*(b^2*n^2+1/4*m^2+1/2*m+1/4)*cos(4*b*ln(c*x^n)+4*a)+2*(1+m)*b*n*(b^2*n 
^2+1/16*m^2+1/8*m+1/16)*sin(2*b*ln(c*x^n)+2*a)+1/4*((1+m)*b*n*sin(4*b*ln(c 
*x^n)+4*a)+12*b^2*n^2+3/4*m^2+3/2*m+3/4)*(b^2*n^2+1/4*m^2+1/2*m+1/4))*x^(1 
+m)/(1+m)/(b^2*n^2+1/16*m^2+1/8*m+1/16)/(b^2*n^2+1/4*m^2+1/2*m+1/4)
 
3.2.23.5 Fricas [A] (verification not implemented)

Time = 0.26 (sec) , antiderivative size = 273, normalized size of antiderivative = 1.03 \[ \int x^m \cos ^4\left (a+b \log \left (c x^n\right )\right ) \, dx=\frac {4 \, {\left (6 \, {\left (b^{3} m + b^{3}\right )} n^{3} x \cos \left (b n \log \left (x\right ) + b \log \left (c\right ) + a\right ) + {\left (4 \, {\left (b^{3} m + b^{3}\right )} n^{3} + {\left (b m^{3} + 3 \, b m^{2} + 3 \, b m + b\right )} n\right )} x \cos \left (b n \log \left (x\right ) + b \log \left (c\right ) + a\right )^{3}\right )} x^{m} \sin \left (b n \log \left (x\right ) + b \log \left (c\right ) + a\right ) + {\left (24 \, b^{4} n^{4} x + 12 \, {\left (b^{2} m^{2} + 2 \, b^{2} m + b^{2}\right )} n^{2} x \cos \left (b n \log \left (x\right ) + b \log \left (c\right ) + a\right )^{2} + {\left (m^{4} + 4 \, m^{3} + 4 \, {\left (b^{2} m^{2} + 2 \, b^{2} m + b^{2}\right )} n^{2} + 6 \, m^{2} + 4 \, m + 1\right )} x \cos \left (b n \log \left (x\right ) + b \log \left (c\right ) + a\right )^{4}\right )} x^{m}}{m^{5} + 64 \, {\left (b^{4} m + b^{4}\right )} n^{4} + 5 \, m^{4} + 10 \, m^{3} + 20 \, {\left (b^{2} m^{3} + 3 \, b^{2} m^{2} + 3 \, b^{2} m + b^{2}\right )} n^{2} + 10 \, m^{2} + 5 \, m + 1} \]

input
integrate(x^m*cos(a+b*log(c*x^n))^4,x, algorithm="fricas")
 
output
(4*(6*(b^3*m + b^3)*n^3*x*cos(b*n*log(x) + b*log(c) + a) + (4*(b^3*m + b^3 
)*n^3 + (b*m^3 + 3*b*m^2 + 3*b*m + b)*n)*x*cos(b*n*log(x) + b*log(c) + a)^ 
3)*x^m*sin(b*n*log(x) + b*log(c) + a) + (24*b^4*n^4*x + 12*(b^2*m^2 + 2*b^ 
2*m + b^2)*n^2*x*cos(b*n*log(x) + b*log(c) + a)^2 + (m^4 + 4*m^3 + 4*(b^2* 
m^2 + 2*b^2*m + b^2)*n^2 + 6*m^2 + 4*m + 1)*x*cos(b*n*log(x) + b*log(c) + 
a)^4)*x^m)/(m^5 + 64*(b^4*m + b^4)*n^4 + 5*m^4 + 10*m^3 + 20*(b^2*m^3 + 3* 
b^2*m^2 + 3*b^2*m + b^2)*n^2 + 10*m^2 + 5*m + 1)
 
3.2.23.6 Sympy [F(-1)]

Timed out. \[ \int x^m \cos ^4\left (a+b \log \left (c x^n\right )\right ) \, dx=\text {Timed out} \]

input
integrate(x**m*cos(a+b*ln(c*x**n))**4,x)
 
output
Timed out
 
3.2.23.7 Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 3537 vs. \(2 (266) = 532\).

Time = 0.43 (sec) , antiderivative size = 3537, normalized size of antiderivative = 13.30 \[ \int x^m \cos ^4\left (a+b \log \left (c x^n\right )\right ) \, dx=\text {Too large to display} \]

input
integrate(x^m*cos(a+b*log(c*x^n))^4,x, algorithm="maxima")
 
output
1/16*(((cos(8*b*log(c))*cos(4*b*log(c)) + sin(8*b*log(c))*sin(4*b*log(c)) 
+ cos(4*b*log(c)))*m^4 + 4*(cos(8*b*log(c))*cos(4*b*log(c)) + sin(8*b*log( 
c))*sin(4*b*log(c)) + cos(4*b*log(c)))*m^3 + 16*(b^3*cos(4*b*log(c))*sin(8 
*b*log(c)) - b^3*cos(8*b*log(c))*sin(4*b*log(c)) + b^3*sin(4*b*log(c)) + ( 
b^3*cos(4*b*log(c))*sin(8*b*log(c)) - b^3*cos(8*b*log(c))*sin(4*b*log(c)) 
+ b^3*sin(4*b*log(c)))*m)*n^3 + 6*(cos(8*b*log(c))*cos(4*b*log(c)) + sin(8 
*b*log(c))*sin(4*b*log(c)) + cos(4*b*log(c)))*m^2 + 4*(b^2*cos(8*b*log(c)) 
*cos(4*b*log(c)) + b^2*sin(8*b*log(c))*sin(4*b*log(c)) + (b^2*cos(8*b*log( 
c))*cos(4*b*log(c)) + b^2*sin(8*b*log(c))*sin(4*b*log(c)) + b^2*cos(4*b*lo 
g(c)))*m^2 + b^2*cos(4*b*log(c)) + 2*(b^2*cos(8*b*log(c))*cos(4*b*log(c)) 
+ b^2*sin(8*b*log(c))*sin(4*b*log(c)) + b^2*cos(4*b*log(c)))*m)*n^2 + 4*(c 
os(8*b*log(c))*cos(4*b*log(c)) + sin(8*b*log(c))*sin(4*b*log(c)) + cos(4*b 
*log(c)))*m + 4*((b*cos(4*b*log(c))*sin(8*b*log(c)) - b*cos(8*b*log(c))*si 
n(4*b*log(c)) + b*sin(4*b*log(c)))*m^3 + 3*(b*cos(4*b*log(c))*sin(8*b*log( 
c)) - b*cos(8*b*log(c))*sin(4*b*log(c)) + b*sin(4*b*log(c)))*m^2 + b*cos(4 
*b*log(c))*sin(8*b*log(c)) - b*cos(8*b*log(c))*sin(4*b*log(c)) + 3*(b*cos( 
4*b*log(c))*sin(8*b*log(c)) - b*cos(8*b*log(c))*sin(4*b*log(c)) + b*sin(4* 
b*log(c)))*m + b*sin(4*b*log(c)))*n + cos(8*b*log(c))*cos(4*b*log(c)) + si 
n(8*b*log(c))*sin(4*b*log(c)) + cos(4*b*log(c)))*x*x^m*cos(4*b*log(x^n) + 
4*a) + 4*((cos(6*b*log(c))*cos(4*b*log(c)) + cos(4*b*log(c))*cos(2*b*lo...
 
3.2.23.8 Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 225232 vs. \(2 (266) = 532\).

Time = 6.15 (sec) , antiderivative size = 225232, normalized size of antiderivative = 846.74 \[ \int x^m \cos ^4\left (a+b \log \left (c x^n\right )\right ) \, dx=\text {Too large to display} \]

input
integrate(x^m*cos(a+b*log(c*x^n))^4,x, algorithm="giac")
 
output
-1/16*(384*b^4*n^4*x*abs(x)^m*tan(2*b*n*log(abs(x)) + 2*b*log(abs(c)))^2*t 
an(b*n*log(abs(x)) + b*log(abs(c)))^2*tan(1/4*pi*m*sgn(x) - 1/4*pi*m)^2*ta 
n(2*a)^2*tan(a)^2 - 256*b^3*m*n^3*x*abs(x)^m*e^(pi*b*n*sgn(x) - pi*b*n + p 
i*b*sgn(c) - pi*b)*tan(2*b*n*log(abs(x)) + 2*b*log(abs(c)))^2*tan(b*n*log( 
abs(x)) + b*log(abs(c)))^2*tan(1/4*pi*m*sgn(x) - 1/4*pi*m)^2*tan(2*a)^2*ta 
n(a) - 256*b^3*m*n^3*x*abs(x)^m*e^(-pi*b*n*sgn(x) + pi*b*n - pi*b*sgn(c) + 
 pi*b)*tan(2*b*n*log(abs(x)) + 2*b*log(abs(c)))^2*tan(b*n*log(abs(x)) + b* 
log(abs(c)))^2*tan(1/4*pi*m*sgn(x) - 1/4*pi*m)^2*tan(2*a)^2*tan(a) - 32*b^ 
3*m*n^3*x*abs(x)^m*e^(2*pi*b*n*sgn(x) - 2*pi*b*n + 2*pi*b*sgn(c) - 2*pi*b) 
*tan(2*b*n*log(abs(x)) + 2*b*log(abs(c)))^2*tan(b*n*log(abs(x)) + b*log(ab 
s(c)))^2*tan(1/4*pi*m*sgn(x) - 1/4*pi*m)^2*tan(2*a)*tan(a)^2 - 32*b^3*m*n^ 
3*x*abs(x)^m*e^(-2*pi*b*n*sgn(x) + 2*pi*b*n - 2*pi*b*sgn(c) + 2*pi*b)*tan( 
2*b*n*log(abs(x)) + 2*b*log(abs(c)))^2*tan(b*n*log(abs(x)) + b*log(abs(c)) 
)^2*tan(1/4*pi*m*sgn(x) - 1/4*pi*m)^2*tan(2*a)*tan(a)^2 + 32*b^3*m*n^3*x*a 
bs(x)^m*e^(2*pi*b*n*sgn(x) - 2*pi*b*n + 2*pi*b*sgn(c) - 2*pi*b)*tan(2*b*n* 
log(abs(x)) + 2*b*log(abs(c)))^2*tan(b*n*log(abs(x)) + b*log(abs(c)))^2*ta 
n(1/4*pi*m*sgn(x) - 1/4*pi*m)*tan(2*a)^2*tan(a)^2 + 256*b^3*m*n^3*x*abs(x) 
^m*e^(pi*b*n*sgn(x) - pi*b*n + pi*b*sgn(c) - pi*b)*tan(2*b*n*log(abs(x)) + 
 2*b*log(abs(c)))^2*tan(b*n*log(abs(x)) + b*log(abs(c)))^2*tan(1/4*pi*m*sg 
n(x) - 1/4*pi*m)*tan(2*a)^2*tan(a)^2 - 256*b^3*m*n^3*x*abs(x)^m*e^(-pi*...
 
3.2.23.9 Mupad [B] (verification not implemented)

Time = 28.48 (sec) , antiderivative size = 152, normalized size of antiderivative = 0.57 \[ \int x^m \cos ^4\left (a+b \log \left (c x^n\right )\right ) \, dx=\frac {3\,x\,x^m}{8\,m+8}+\frac {x\,x^m\,{\mathrm {e}}^{a\,2{}\mathrm {i}}\,{\left (c\,x^n\right )}^{b\,2{}\mathrm {i}}}{4\,m+4+b\,n\,8{}\mathrm {i}}+\frac {x\,x^m\,{\mathrm {e}}^{-a\,2{}\mathrm {i}}\,\frac {1}{{\left (c\,x^n\right )}^{b\,2{}\mathrm {i}}}\,1{}\mathrm {i}}{m\,4{}\mathrm {i}+8\,b\,n+4{}\mathrm {i}}+\frac {x\,x^m\,{\mathrm {e}}^{a\,4{}\mathrm {i}}\,{\left (c\,x^n\right )}^{b\,4{}\mathrm {i}}}{16\,m+16+b\,n\,64{}\mathrm {i}}+\frac {x\,x^m\,{\mathrm {e}}^{-a\,4{}\mathrm {i}}\,\frac {1}{{\left (c\,x^n\right )}^{b\,4{}\mathrm {i}}}\,1{}\mathrm {i}}{m\,16{}\mathrm {i}+64\,b\,n+16{}\mathrm {i}} \]

input
int(x^m*cos(a + b*log(c*x^n))^4,x)
 
output
(3*x*x^m)/(8*m + 8) + (x*x^m*exp(a*2i)*(c*x^n)^(b*2i))/(4*m + b*n*8i + 4) 
+ (x*x^m*exp(-a*2i)/(c*x^n)^(b*2i)*1i)/(m*4i + 8*b*n + 4i) + (x*x^m*exp(a* 
4i)*(c*x^n)^(b*4i))/(16*m + b*n*64i + 16) + (x*x^m*exp(-a*4i)/(c*x^n)^(b*4 
i)*1i)/(m*16i + 64*b*n + 16i)